1. Field of the Invention
The present invention relates to an image processing apparatus that electronically corrects a distortion of an image imaged by an imaging element, and an imaging apparatus using the same.
2. Related Art
Generally, in an imaging device that images optical information fetched through a lens, a distortion is generated in an imaged image due to an aberration of the lens. There are a barrel-shaped distortion and a spool-shaped distortion as examples of the distortion, and a degree of the distortion is different in accordance with a magnification or a specification of the lens. For example, in a zoom lens, the distortion easily occurs on the wide side (on the side of a shorter focal distance).
In a field of an electronic camera, a technique of electronically correcting the distortion due to the aforementioned lens characteristic (referred to as a “distortion correction” hereafter) is devised (for example, see Japanese Patent No. 3035992).
For example, when an object as shown in FIG. 18A is shot by an electronic camera, the image which is distorted in a barrel shape due to the lens characteristic as shown in FIG. 18B is formed on the imaging element such as a CCD in the electronic camera. FIG. 18C shows such a distorted image which is corrected electronically. In FIGS. 18A to 18C, point s1, point a1, and point b1 correspond to each other, and point sm, point am, and point bm correspond to each other. It is found that a larger distortion appears in the vicinity of the point a1, compared to the vicinity of the point am. As shown in FIG. 18C, the points a1 and am are respectively corrected to be disposed at an original position by means of a distortion correction processing.
The distortion correction processing of the image is achieved by a mapping conversion as follows. A coordinate system on an imaged image (referred to as an “input coordinate system” hereafter.) and a coordinate system on a corrected image (referred to as an “output coordinate system” hereafter.) are taken into consideration. Positions of lattice points in the input coordinate system and output coordinate system are related to positions of pixels of the imaged image and the corrected image, respectively. In the distortion correction processing, in such a coordinate system, image data of each pixel on the input coordinate system is mapped on the output coordinate system using a predetermined function f. Then, image information (luminance information and color difference information) of the lattice points on the output coordinate system (referred to as “output coordinate points” hereafter.) is obtained by interpolating (compositing) the image information of mapped pixels in the vicinity of the lattice points. In this way, the image information regarding each lattice point (pixel) is obtained on the output coordinate system to correct the distortion.
A specific explanation will be made with reference to FIG. 19. The point a1 in the input coordinate system (coordinate system on the imaged image) is mapped to the point b1 in the output coordinate system (coordinate system on the corrected image) with the mapping function f. The other point am in the input coordinate system is mapped to the point bm in the output coordinate system (coordinate system of the corrected image) with the mapping function f. The mapping function f is obtained based on the lens characteristic and a zoom magnification.
Necessary information on the corrected image is image information on the lattice points (output coordinate points), and generally, the mapped points b1 and bm of the output coordinate system do not exist on the output coordinate system. Therefore, image data of an output coordinate point is obtained by interpolating (compositing) the image data of a plurality of pixels mapped in the vicinity of the output coordinate point. For example, as shown in FIG. 19, the image data of an output coordinate point Q1 can be obtained by interpolating (compositing) the image data of pixels b1, b2, bk and bk+1 mapped to the vicinity of the output coordinate point Q1. Similarly, the image data of an output coordinate point Qm can be obtained by interpolating (compositing) the image data of pixels bm, bm+1, bn and bn+1 mapped to the vicinity of the output coordinate point Qm. In this way, in the output coordinate system, the image data of the output coordinate point, namely, corrected data is obtained by interpolation (composition).
As described above, the distortion correction all over the image is performed by obtaining the mapped points on the output coordinate system and compositing the image data, while sequentially scanning each input coordinate point over the imaged image.
In FIG. 18C, a region in the vicinity of the point b1 is obtained by interpolating regions which having relatively large distortion in the imaged image, and a region in the vicinity of the point bm is obtained by interpolating regions which having relatively small distortion in the imaged image. For correction of a region with large distortion such as a region in the vicinity of the point b1, image portion for plurality of lines in the imaged image should be read to obtain information required for correction. On the contrary, for correction of a region with small distortion such as a region in the vicinity of the point bm, image portion for relatively small number of lines in the imaged image should be read to obtain information required for correction
Like this, in order to obtain one line of a corrected image by mapping, there may be a case which requires data corresponding to a lot of lines in the input image. That is, in order to output the corrected image data to a buffer memory in each line, some memories are required for holding data for a lot of lines in the imaged image during wait for processing of unprocessed pixels. However, provision of a lot of line memories causes a problem in a configuration to increase number of electronic parts by the number of line memories.